1. Field of the Invention
The present invention relates to a method, system, and program for handling device interrupts.
2. Description of the Related Art
In many operating systems, such as Microsoft Windows®, Linux®, Unix®, etc. multiple devices may communicate over a bus interface with the operating system interrupt service routine (ISR) using a single interrupt line. (Microsoft and Windows are registered trademarks of Microsoft Corporation, Linux is a registered trademark of Linus Torvalds, UNIX is a registered trademark of The Open Group). One of multiple devices using an interrupt line, would assert an interrupt on the bus to the interrupt line assigned to that device to request or transmit data to the operating system. The operating system would further execute various device driver programs that provide a software interface between the operating system and the device. A device driver includes device specific commands to communicate with and control one attached device. Upon receiving a device interrupt, the operating system ISR would poll each device driver interrupt service routine (ISR) running in the operating system to identify the device driver ISR associated with the device that asserted the interrupt.
In response to receiving the polling request from the operating system ISR asking the device driver ISR whether the interrupt is from the device driver's device, the device driver ISR communicates with the associated device and reads an interrupt status register in the device to determine whether the driver's device sent the interrupt request. In Microsoft® Windows® operating systems, if the driver's device status registers indicate that the device did send an interrupt request, then the device driver ISR responds to the operating system ISR by claiming the interrupt and requesting a deferred procedure call (DPC) to process the device request that is the subject of the interrupt request. In operating systems other than Windows, such as Linux® and Unix®, upon claiming the interrupt, the device driver ISR does not issue a request for a DPC and instead directly performs the work. The device driver will further write to the device's mask register to disable the device's interrupts to cause the device to deassert the interrupt request line and will separately write the read interrupt status to the device's interrupt status register to acknowledge the device's interrupt. If a device driver ISR responds that the interrupt is not from the device associated with the driver, then the operating system ISR determines a next device driver in a chain of device drivers to poll and sends the request to the next device driver ISR in the chain. The operating system ISR continues polling device driver ISRs in the list until one device driver ISR claims the interrupt and requests DPC resources.
When the device driver ISR reads the device status registers to determine whether the driver's device generated the interrupt, the processor must delay processing until the device register is read and the device driver ISR responds to the polling request. Reading a device status register over an I/O bus may take a relatively significant amount of time, thus increasing the latency of the device driver ISR operations, which in turn reduce processor performance.
For these reasons, there is a need in the art to provide improved techniques for handling device interrupt requests.